<?php


namespace Api\Controller;

use Think\Controller;

class AdMoreToolsController extends Controller
{

    function __construct()
    {
    }

    function _initialize()
    {
        parent::_initialize();
    }

    //获取更多工具
    public function getMoreTools()
    {
        $appid = I('appid');
        $sql = "select r.listorder,t.* from cmf_program_tools_relation r left join cmf_more_tools t on t.id=r.tools_id
where r.appid='$appid' and r.status=1 and t.status=1
order by r.listorder desc";
        $res = M()->query($sql);
        $this->returnok($res, 'ok');
    }

    //获取广告
    public function getAd()
    {
        $appid = I('appid');
        $sql = "select r.position,r.is_show,t.* from cmf_program_ad_relation r 
left join cmf_ad t on t.id=r.ad_id
where r.appid='$appid' and r.status=1 and t.status=1";
        $res = M()->query($sql);
        $this->returnok($res, 'ok');
    }



}


